#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

salaries = {
    "axiong": 10000,
    "wen": 99000,
    "hei": 19999,
    "bai": 22222
}

print(max(salaries))  # xiong


# max(iterable, *[, default = obj, key = func]) -> value
# max(arg1, arg2, *args, *[, key = func]) -> value
def fun(k):
    return salaries[k]


# 最大值就是w，但func却只需要一次性使用，这里就可以直接使用匿名函数了
print(max(salaries))
print(max(salaries, key=lambda k: salaries[k]))  # wen
print(min(salaries, key=lambda k: salaries[k]))  # axiong

